import request from '@/utils/request'

/**
 * 获取审批列表
 * @param {*} param0
 */
export async function getApproveList({ current = 1, ...args }) {
  return request('/approve/list', {
    method: 'POST',
    data: {
      current,
      ...args,
    },
  })
}

/**
 * 查看审批列表
 * @param {*} param0
 */
export async function getApproveDetail({ current = 1, size = 5, ...args }) {
  return request('/approve/listItem', {
    method: 'POST',
    data: {
      current,
      size,
      ...args,
    },
  })
}

/**
 * 执行审批
 * @param {*} params
 */
export async function consentApprove(params) {
  return request('/approve/consent', {
    method: 'POST',
    data: params,
  })
}

/**
 * 通过OrgId获取用户信息 审批时使用
 * @param {*} params
 */
export async function findUserByOrgId(params) {
  return request('/cuser/findUserByOrgId', {
    method: 'POST',
    data: params,
  })
}
